<template>
  <div class="header-extra hoverable" @click="onLogout">
    <span>安全退出</span>
  </div>
</template>

<script>
import { mapActions } from "vuex";
export default {
  methods: {
    ...mapActions(["logout"]),
    onLogout() {
      this.$Modal.confirm({
        title: "操作确认",
        content: "退出后，未保存的内容将会丢失<br/>确定要退出吗？",
        closable: true,
        onOk: () => {
          this.logout();
        },
      });
    },
  },
};
</script>
